package com.zhanglingfei.yuekaoclient.config;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author 张凌飞$
 * @DATE 2022/3/2$
 **/
@Data
@Accessors(chain = true)
public class MsgResult {

    private boolean result;
    private Integer errorCode;
    private String message;
    private Object data;

    public static MsgResult ok(){
        return new MsgResult().setResult(true);
    }

    public static MsgResult ok(Object data){
        return new MsgResult().setData(data).setResult(true);
    }

//    public static MsgResult error(Integer errorCode,String message){
//        return new MsgResult().setResult(false).setErrorCode(errorCode).setMessage(message);
//    }

    public static MsgResult error(String message){
        return new MsgResult().setResult(false).setMessage(message);
    }
}
